const path = require('path');
/**
 * 前端参数名 file
 * 格式数据 form-data
 */
exports.upload = async ctx => {
  const { file } = ctx.request.files;
  if (file) {
    ctx.body = {
      code: 0,
      message: '资源上传成功',
      result: {
        url: process.env.UPLOAD_URL + path.basename(file.path)
      }
    };
  }
};
